import {StorageStrategy, StorageUtil} from "@/util/storage.ts";
import {DEFAULT_DATA_SECRET_KEY} from "@/common/comConstant/commoncanstant.ts";

export function storageHook(strategy: StorageStrategy=StorageStrategy.SESSION_STORAGE, openSecret: boolean = true, key: string = DEFAULT_DATA_SECRET_KEY) {
    const storage = new StorageUtil().buildStrategy(strategy).buildKey(key).buildOpenSecret(openSecret)
    return {
        storage: storage
    }
}

